#include <iostream>
using namespace std;

const int kMaxN = 1e5 + 10;

int a[kMaxN], diff[kMaxN];

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;

  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    diff[i] = a[i] - a[i - 1];
  }

  long long sum1 = 0, sum2 = 0;

  for (int i = 2; i <= n; i++) {
    if (diff[i] > 0) {
      sum1 += diff[i];
    } else {
      sum2 -= diff[i];
    }
  }
  cout << max(sum1, sum2) << "\n"
       << abs(a[n] - a[1]) + 1 << "\n";
  return 0;
}